package com.example.cloud.model.inventory;


import com.example.cloud.model.common.CommonModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Version;

/**
 * Created by wangtao on 2018/7/30.
 * 库存
 */
@Entity(name = "inventory")
@Data
@EqualsAndHashCode(callSuper = false)
public class Inventory extends CommonModel {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    // 商品编号
    @Column(name = "item_id")
    private Long itemId;
    // 商品名称
    @Column(name = "item_name")
    private String itemName;
    // 总库存
    @Column(name = "total_inventory", columnDefinition = "INT default 0")
    private int totalInventory;
    // 可用库存
    @Column(name = "use_inventory", columnDefinition = "INT default 0")
    private int useInventory;
    // 锁定库存
    @Column(name = "lock_inventory", columnDefinition = "INT default 0")
    private int lockInventory;
    // 账户编号
    @Column(name = "account_id")
    private Long accountId;
    @Column(name = "user_id")
    private Long userId;
    @Column(name = "organ_id")
    private Long organId;
    @Column(name = "organ_name")
    private String organName;
    @Version
    @Column(name = "version")
    private Integer version;
}
